<?php 
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//THIS FILE IS USED TO DISPLAY THE SUMMARY
$con = mysql_connect('localhost:3306', 'root', 'vamshi');
if(!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("CollabSum", $con);
$url = $_REQUEST["p"];

////////////////////////////////////////////////////////////////////////////////////////////////////////
// SELECT THE BEST RANK AND SUMMARY CORRESPONDING TO IT AND DISPLAY THE SUMMARY TO THE USER

$view = "select summ,MAX(rank) from summary where url='$url' group by summ";
$value = mysql_query($view);
if(mysql_num_rows($value) == 0) {
	echo "There are no entries!";
}
if(mysql_num_rows($value)!=0) {
	while($row = mysql_fetch_array($value)){
			$summary = $row['summ'];
			echo $summary;		
		}
}
?>